#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int shu, i;
////scanf("%d", &shu);
////for (i = 0; shu; shu = shu / 10)
////i = i + shu % 10;
////printf("%d", i);

int wei(int shu)
{
	if (!(shu / 10))
		return shu;
	else return shu % 10 + wei(shu / 10);
}

int mainmwh()
{
	scanf("%d", &shu);
	printf("%d", wei(shu));
	return 0;
}